import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import jsx from '@vitejs/plugin-vue-jsx'

export default defineConfig(() => {
  const conf = {
    root: 'demo',
    publicDir: 'demo/public',
    css: {
      preprocessorOptions: {
        less: {
          modifyVars: {
            // 'primary-color': '#52c41a',
            // 'font-path': '/package/theme/iconfont/',
            // hack: `true; @import (reference) "${resolve('src/style/global/config.less')}";`,
          },
          javascriptEnabled: true,
        }
      }
    },
    build: {
      outDir: __dirname + '/example',
    },
    plugins: [
      vue(),
      jsx(),
    ],
  }
  return conf
})
